package dljk.core;

// перечень мастей
enum CardSuites {SPADES, CLUBS, DIAMONDS, HEARTS};

public class GameCard{

    public GameCard(int cardRank, int cardPriority, CardSuites cardSuite, boolean isShowFace, boolean isSelected) {
        this.CS_cardSuites = cardSuite;
        this.iCardRank = cardRank;
        this.iCardPriority = cardPriority;
        this.b_isShowFace = isShowFace;
        this.b_isSelected = isSelected;
    }
    
    public GameCard(int nRank, int nPriority, CardSuites aSuite) {
            this (nRank, nPriority, aSuite, false, false);
    }
    
    public GameCard(int nRank, CardSuites aSuite) {
            this (nRank, nRank, aSuite, false, false);
    }

    public int getPriority() {
        return iCardPriority;
    }

    public void setPriority(int priority) {
        this.iCardPriority = priority;
    }

    public int getRank() {
            return iCardRank;
    }

    public CardSuites getSuite() {
            return CS_cardSuites;
    }

    public boolean getFace() {
            return b_isShowFace;
    }

    public boolean setFace(boolean newFace) {
            boolean oldFace = b_isShowFace;
            b_isShowFace = newFace;
            return oldFace;
    }

    public boolean getSelected() {
            return b_isSelected;
    }

    public boolean setSelected(boolean newSel) {
            boolean oldSel = b_isSelected;
            b_isSelected = newSel;
            return oldSel;
    }

    @Override
    public String toString() {
        return "\nCard{" + "suite=" + CS_cardSuites + ", rank=" + iCardRank + ", priority=" + iCardPriority + '}';
    }
        
        // масть
        private CardSuites CS_cardSuites;
        // достоинство
        private int iCardRank;
        // iCardPriority
        private int iCardPriority;
        // отображать рисунок или рубашку
        private boolean b_isShowFace;
        // выделена карта
        private boolean b_isSelected;
}